package com.health.medicine.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import com.health.medicine.model.enums.TransportVehiclesEnum;
import lombok.Data;

/**
 * 运输车辆信息表
 * @TableName TransportUnitVehicles
 */
@TableName(value ="TransportUnitVehicles")
@Data
public class TransportUnitVehicles implements Serializable {
    /**
     * 车辆唯一标识
     */
    @TableId(type = IdType.AUTO)
    private Long vehicleId;

    /**
     * 关联运输单位的ID
     */
    private Long transportUnitId;

    /**
     * 车牌号
     */
    private String vehicleNumber;

    /**
     * 车辆类型
     */
    private String vehicleType;

    /**
     * 运输容量
     */
    private Integer capacity;

    /**
     * 上次维护日期
     */
    private Date lastMaintenanceDate;

    /**
     * 车辆状态
     */
    private TransportVehiclesEnum status;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 逻辑删除标志，1 表示已删除
     */
    private Integer isDelete;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TransportUnitVehicles other = (TransportUnitVehicles) that;
        return (this.getVehicleId() == null ? other.getVehicleId() == null : this.getVehicleId().equals(other.getVehicleId()))
            && (this.getTransportUnitId() == null ? other.getTransportUnitId() == null : this.getTransportUnitId().equals(other.getTransportUnitId()))
            && (this.getVehicleNumber() == null ? other.getVehicleNumber() == null : this.getVehicleNumber().equals(other.getVehicleNumber()))
            && (this.getVehicleType() == null ? other.getVehicleType() == null : this.getVehicleType().equals(other.getVehicleType()))
            && (this.getCapacity() == null ? other.getCapacity() == null : this.getCapacity().equals(other.getCapacity()))
            && (this.getLastMaintenanceDate() == null ? other.getLastMaintenanceDate() == null : this.getLastMaintenanceDate().equals(other.getLastMaintenanceDate()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getIsDelete() == null ? other.getIsDelete() == null : this.getIsDelete().equals(other.getIsDelete()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getVehicleId() == null) ? 0 : getVehicleId().hashCode());
        result = prime * result + ((getTransportUnitId() == null) ? 0 : getTransportUnitId().hashCode());
        result = prime * result + ((getVehicleNumber() == null) ? 0 : getVehicleNumber().hashCode());
        result = prime * result + ((getVehicleType() == null) ? 0 : getVehicleType().hashCode());
        result = prime * result + ((getCapacity() == null) ? 0 : getCapacity().hashCode());
        result = prime * result + ((getLastMaintenanceDate() == null) ? 0 : getLastMaintenanceDate().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getIsDelete() == null) ? 0 : getIsDelete().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", vehicleId=").append(vehicleId);
        sb.append(", transportUnitId=").append(transportUnitId);
        sb.append(", vehicleNumber=").append(vehicleNumber);
        sb.append(", vehicleType=").append(vehicleType);
        sb.append(", capacity=").append(capacity);
        sb.append(", lastMaintenanceDate=").append(lastMaintenanceDate);
        sb.append(", status=").append(status);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", isDelete=").append(isDelete);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}